*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno


********************************************************************************
****----						Analysis 					    		----**** 
********************************************************************************

preserve
drop if anno==2015
keep if special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"
gen pop_2=1 if population_anagrafe_DSP<=5000
replace pop_2=2 if population_anagrafe_DSP>5000 & population_anagrafe_DSP<=15000
replace pop_2=3 if population_anagrafe_DSP>15000
collapse (sum) corruption_abs, by(anno pop_2)
twoway connected corruption_abs anno if pop_2==1, graphregion(color(white)) lpattern(solid) lcolor(black) mcolor(black) xlabel(2004 (1) 2014, angle(45)) xtitle("") ytitle("")  title("")  ylabel(, angle(45)) legend(label(1 "<=5,000") label(2 "5,000-15,000") label(3 ">15,000") rows(1)) || connected corruption_abs anno if pop_2==2, lpattern(solid) lcolor(eltblue) mcolor(eltblue) || connected corruption_abs anno if pop_2==3, lpattern(solid) lcolor(blue) mcolor(blue)
gr export "$folder/Figures/Figure2.png" , replace 
restore

